Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convective exit #74

Merged
merged 7 commits into from
Oct 14, 2023
Merged

Conversation

marinlauber
Copy link
Member

@marinlauber marinlauber commented Sep 7, 2023

Initial commit for convective exit implementation. The 1D convection equation is applied to the 1 direction at the outlet during the first step of the predictor-corrector. A global mass flux correction ensures mass conservation on the domain. This mass flux correction imposes a Dirichlet condition (as the standard BC!(a,A)) when the time-step is omitted (for all other calls of BCΔt!(a,A) basically).

What we need to check:

  • check that a non-uniform profile is convected and scaled such that global mass flux match
  • check that without time-step the mass flux check imposes the same Dirichlet BC on the outlet as the inlet
  • check that the velocity profile at the convective exit is not uniform for the flow behind a cylinder
  • check pressure isocontour on exit
  • check if we can get rid of the original BC!(a,A) function (might be an issue here https://github.com/marinlauber/WaterLily/blob/2d4787c19f1675d756acb4763539223a5999ea19/src/Body.jl#L54) which sets the Homogeneous Neumann for the pressure solver

The time integration works, but there is a mismatch between the pressure field obtained with this and the one we get in Lotus.

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #74 (62793e0) into master (adb4784) will decrease coverage by 0.14%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
- Coverage   93.89%   93.76%   -0.14%     
==========================================
  Files           8        8              
  Lines         377      385       +8     
==========================================
+ Hits          354      361       +7     
- Misses         23       24       +1     
Files Coverage Δ
src/Flow.jl 98.73% <100.00%> (+0.03%) ⬆️
src/WaterLily.jl 83.33% <100.00%> (ø)
src/util.jl 83.82% <84.61%> (-0.05%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

The main problem with the previous version were the `a.u .= 0` and `a.u ./= 2` lines in `mom_step!` which kept modifying the exit plane values. I changed these lines to only update the values inside the domain.

I added an `flow.exit` to the struct and initialization functions and use this to trigger the convection exit behavior.

The `apply!` function had the opposite problem - it WASN'T filling in the boundary value. Now it does.

It also seemed weird to me that the convection exit value in Lotus was based on the old value at the boundary but the u* value (before projection) upstream. I'm not sure it matters much, but it seems more consistent to just use the old values in both places, so that's what it does now.

Finally, I added a Lamp vortex dipole test case, which is nice since it should leave the exit without changing size or speed.
@weymouth
Copy link
Collaborator

We still need to get create specific exit tests (and get rid of the other file).

src/util.jl Outdated Show resolved Hide resolved
@weymouth weymouth marked this pull request as ready for review October 13, 2023 14:55
@weymouth weymouth merged commit a2d7661 into WaterLily-jl:master Oct 14, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants